\name{EstimateAbundance}
\alias{EstimateAbundance}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{ Estimate Abundance of Point Count Data }
\description{
Estimate simple abundance for a set of species for a given set of years and months, selected by user 
}
\usage{
EstimateAbundance(data = NULL, min.month = 3, max.month = 8, year = NULL, station = "ALL", species = "ALL", group.station = FALSE, ...)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{data}{ a data.frame of the same form as the retrieved from \link{getPCdata}}
  \item{min.month}{ Minimum month for each year}
  \item{max.month}{ Maximum value for month each year  }
  \item{year}{ Numeric vector of years to include in analysis }
  \item{station}{ A vector of stations to include in the analysis }
  \item{species}{ A vector of species to include in the analysis}
  \item{group.station}{ Boolean.  If set to TRUE, all estimates are across the stations.  FALSE (default) provides information uniquely for each station. }
  \item{\dots}{ additional variables passed on to internal functions }
}
\details{
  Currently this is simply based on the number of individuals
  detected at a station.  Specifically, first the average number
  of birds (of a given species) detected at each point within
  a station is calculated.  This average is then averaged across
  all points to generate an average number of birds detected at
  the site.  The variance (and standard errors) are currently
  only based on the variance among points.  The within point
  variation is ignored.  Likewise, sample size is simply
  calculated as the number of points surveyed that year.
  
  Future development:
  \itemize{
      \item Create a distance filter (to restrict birds seen only within a specific distance)
      \item Create a detection cue filter (e.g. to filter birds that were detected as flyovers).
      \item Incorporate the ability to estimate density (might include function name change).
  }
 
  
  
}
\value{
  a data.frame that contains the abundances estimated
}
\references{ ~put references to the literature/web site here ~ }
\author{ Mark Herzog \email{mherzog@prbo.org} }
\section{Warning }{By using \code{group.station} The values are averaged at the
  point level.  In other words, the program does not estimate
  the value for each station first, and then average the values.
  Instead the program will average all of the points together.
  Sample size and variance will reflect this as well.  This
  shouldn't effect the averages but it will change the variance
  and standard errors.
}
\seealso{ \code{\link{EstimateSpeciesRichness}} }
\examples{
# Note: You must have your MySQL configured correctly to access databases within data.prbo.org
# Ask \email{mherzog@prbo.org} for more information
#
pcdata<-getPCdata(database='digir-ro',station=c("PALO","PTAR"))
palo.abund<-EstimateAbundance(pcdata,station="PALO",max.month=7)
ptar.abund<-EstimateAbundance(pcdata,station="PTAR",max.month=7)
# averages all the points to get an average estimate across stations
# combined.abund<-EstimateAbundance(pcdata,group.station=TRUE,max.month=7)
}

% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ datagen }
